% exports the first two columns of the given matrix as two
% impulse responses ir_mid and ir_sid as compilable C code.
function mat2c(m, filename)
	myfile = fopen(filename,'wt');
	l = size(m,1);
	fprintf(myfile,'static const int ir_length = %i;\n',l);
	fprintf(myfile,'static const float ir_mid[] = {\n');
	for k=1:l-1
	fprintf(myfile,'%g,\n',m(k,1));
	end;
	fprintf(myfile,'%g\n',m(end,1));
	fprintf(myfile,'};\n');
	fprintf(myfile,'static const float ir_sid[] = {\n');
	for k=1:l-1
	fprintf(myfile,'%g,\n',m(k,2));
	end;
	fprintf(myfile,'%g\n',m(end,2));
	fprintf(myfile,'};\n');
	fclose(myfile);
return;

